<template>
	<view class="content" :style="{'padding-top':top+'px','min-height':windowheight+'px'}">
		<Navbar title="消息详情" bgColor="#d86784" :backIcon="false" style="color: #ffffff;z-index: 1;"></Navbar>
		<view class="messageleft">
			<view class="messagelefttop">
				<image mode="aspectFill" src="http://zzqjt.oss-cn-hangzhou.aliyuncs.com/templates/photographer/avatar/2f8ad43a259c4a4e93b542e448a7b0f2-1712713590220988418.jpg"></image>
				<view class="text">
					<text>张三</text>
					<uni-dateformat :date="new Date()" format='yyyy-MM-dd hh: mm: ss' class="date"></uni-dateformat>
				</view>
			</view>
			<view class="messageleftbottom">
				s的回复快点双方都是尽快发货速度快季后赛好烦房价开始房价肯定
			</view>
		</view>
		<view class="messageright">
			<view class="messagerighttop">
				<image mode="aspectFill" src="http://zzqjt.oss-cn-hangzhou.aliyuncs.com/templates/photographer/avatar/2f8ad43a259c4a4e93b542e448a7b0f2-1712713590220988418.jpg"></image>
				<view class="text">
					<text>张三</text>
					<uni-dateformat :date="new Date()" format='yyyy-MM-dd hh: mm: ss' class="date"></uni-dateformat>
				</view>
			</view>
			<view class="messagerightbottom">
				s的回复快点双方都是尽快发货速度快季后赛好烦房价开始房价肯定
			</view>
		</view>
	</view>
</template>
<script setup>
	import { ref,onMounted } from 'vue'
	import {
		onShow,
		onLoad
	} from '@dcloudio/uni-app'
	const url = getApp().globalData.url
	const title=ref('Hello')
	const windowheight=ref()
	const platform = ref()
	const statusBar = ref()
	const customBar = ref()
	const top = ref()
	const getColumnHeight=()=>{
		uni.getSystemInfo({
			success(res) {
				console.log(res)
				platform.value = res.platform
				windowheight.value=res.screenHeight
				// #ifdef MP-WEIXIN
				statusBar.value = res.statusBarHeight
				const custom = wx.getMenuButtonBoundingClientRect()
				customBar.value = custom.bottom + custom.top - res.statusBarHeight
				// #endif
				// #ifdef APP-PLUS
				statusBar.value = res.statusBarHeight
				customBar.value = res.statusBarHeight + 45
				// 这里是在安卓手机上加上 3 像素（当时好像是在安卓水滴屏上，系统导航栏高度较低才加上去的，大家可以真机自己调试一下）
				if (res.platform == "android") {
					statusBar.value += 3
					customBar.value += 3
				}
				// #endif
			}
		})
		top.value = customBar.value
		windowheight.value=windowheight.value-top.value
		//console.log(statusBar.value, customBar.value, top.value,windowheight.value)
	}
	onShow(()=>{
		const now = new Date().getTime()
		if (!uni.getStorageSync('token') || now > uni.getStorageSync('expireTime')) {
			uni.reLaunch({
				url: "/pages/login/login"
			})
		}
	})
	onMounted(()=>{
		getColumnHeight()
	})
</script>
<style lang="less">
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		background-image: linear-gradient(to bottom,#d95e7d,#ffffff);
	}
	.messageleft{
		margin-top: 20rpx;
		width: 100vw;
		.messagelefttop{
			margin-left: 20rpx;
			height: 90rpx;
			display: flex;
			align-items: center;
			image{
				width: 90rpx;
				height: 90rpx;
				border-radius: 50%;
			}
			.text{
				margin-left: 50rpx;
				font-size: 28rpx;
				color: #333333;
				text{
					margin-right: 20rpx;
				}
			}
		}
		.messageleftbottom{
			margin-left: 120rpx;
			background-color: #ffffff;
			max-width: 560rpx;
			border-radius: 20rpx;
			padding: 20rpx;
		}
	}
		
	.messageright{
		margin-top: 20rpx;
		width: 100vw;
		.messagerighttop{
			margin-right: 20rpx;
			height: 90rpx;
			position: relative;
			// display: flex;
			// align-items: center;
			image{
				width: 90rpx;
				height: 90rpx;
				border-radius: 50%;
				float: right;
			}
			.text{
				margin-left: 50rpx;
				font-size: 28rpx;
				color: #333333;;
				float: right;
				position: absolute;
				top: 50%;
				right: 140rpx;
				transform: translate(0,-50%);
				text{
					margin-right: 20rpx;
				}
			}
		}
		.messagerightbottom{
			margin-left: 37.5rpx;
			background-color: #ffffff;
			max-width: 560rpx;
			border-radius: 20rpx;
			padding: 20rpx;
		}
	}
</style>